package com.example.Lezedata.ui.activity.goods;

import android.widget.ImageView;
import android.widget.TextView;

import com.example.Lezedata.R;
import com.example.Lezedata.dataModel.BidDetailManager;
import com.example.Lezedata.ui.activity.baseClass.GBBaseVc;
import com.example.Lezedata.util.GBUtil;

import bid.Bid;

public class ProductDetailVc extends GBBaseVc {
    @Override
    protected int getLayoutId() {
        return R.layout.product_detail;
    }

    @Override
    public CharSequence title() {
        return "Product Detail";
    }

    TextView detailView;
    ImageView imageView;
    @Override
    protected void viewDidLoad() {
        super.viewDidLoad();
        detailView = findViewByTag("detailView");
        imageView = findViewByTag("imageView");

        String gid = getIntent().getStringExtra("goodsId");
        BidDetailManager.getGoodsInfoForId(gid, new BidDetailManager.OnLoadDataComplete() {
            @Override
            public void infoResponse(Bid.GoodsInfo goodsInfo) {
                detailView.setText(goodsInfo.getDesc());
                GBUtil.setGoodsImage(imageView,goodsInfo.getImgUrl());
            }
        });
    }
}
